package com.atguigu.java;

/**
 * @author shkstart
 * @create 2021-02-23 10:03
 */
//@MyAnnotation()
//@MyAnnotation("hi")
//@MyAnnotation("he")
//jdk 8之前
//@Annotations({@MyAnnotation("he"),@MyAnnotation("hi")})
//jdk 8之后
@MyAnnotation("hi")
@MyAnnotation("he")
public class Person {
    private String name;
    private int age;

    public Person() {
    }

    @MyAnnotation()
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @MyAnnotation()
    public void eat() {
        System.out.println("人走了");
    }
}
